import Vue from 'vue'
import VueRouter from 'vue-router'
import Category from '../components/Category.vue'
import Orders from '../components/Orders.vue'
import AddEval from '../components/AddEval.vue'
import Detail from '../components/Detail.vue'
import DetailCourse from '../components/DetailCourse.vue'
import Contents from '../components/Contents.vue'
import OrderAll from '../components/OrderAll.vue'
import Evaluate from '../components/Evaluate.vue'
import OtherOrder from '../components/OtherOrder.vue'
import Login from '../components/Login.vue'
import Register from '../components/Register.vue'
import Index from '../components/Index.vue'
import Discovery from '../components/Discovery.vue'
import My from '../components/My.vue'
import Study from '../components/Study.vue'

Vue.use(VueRouter)

let routes = [
  { path: '/', component: Login },
  { path: '/register', component: Register },
  { path: '/register', component: Register },
  { path: '/category', component: Category },
  { path: '/addEval', component: AddEval },
  { path: '/index', component: Index },
  { path: '/discovery', component: Discovery },
  { path: '/my', component: My },
  { path: '/study', component: Study },
  {
    path: '/orders',
    component: Orders,
    redirect: '/orderAll',
    children: [
      { path: '/orderAll', component: OrderAll },
      { path: '/otherOrder', component: OtherOrder },
    ],
  },
  {
    path: '/detail',
    component: Detail,
    redirect: '/detailCourse',
    children: [
      { path: '/detailCourse', component: DetailCourse },
      { path: '/contents', component: Contents },
      { path: '/evaluate', component: Evaluate },
    ],
  },
]
// let map = new Map([
//   ['/', '登录'],
//   ['/orders', '订单'],
//   ['/category', '分类'],
//   ['/home', '首页'],
//   ['/addEval', '发表评论'],
//   ['/orderAll', '全部订单'],
//   ['/otherOrder', '售后'],
//   ['/detail', '详情'],
//   ['/detailCourse', '介绍'],
//   ['/contents', '目录'],
//   ['/evaluate', '评论'],
// ])
// document.title = map.get()
let router = new VueRouter({ routes })

export default router
